<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 所有资源加载完成
        // 监听页面内容加载完成 后执行
        window.onload = function(){
            let p = document.querySelector('p')
            console.log(p);
            
        }
      
        
    </script>
</head>
<body>
    <p>哈哈哈</p>
    <p>好好</p>
    <img src="https://img.alicdn.com/imgextra/i4/1658624661/O1CN013LRn741kIn228FnXH_!!1658624661.jpg_.webp" alt="">
 
</body>
</html>